//
//  LXMineCenterButton.m
//  LvXi_newVersion
//
//  Created by 诸葛孔明 on 16/8/11.
//  Copyright © 2016年 SJT. All rights reserved.
//............................................................................................//
//......................................个人中心自定义按钮......................................//
//......................................图片在上 文字在下.........................................//

#import "LXMineCenterButton.h"

@implementation LXMineCenterButton

- (instancetype)initWithFrame:(CGRect)frame
{
    if (
        self = [super initWithFrame:frame]) {
        
        self.imageView.contentMode = UIViewContentModeScaleAspectFit;
        
//        self.imageView.backgroundColor = [UIColor redColor];
//        self.titleLabel.backgroundColor = [UIColor blueColor];
        
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imageView.y         = 18;
    self.imageView.height    = MineRatio(29);
    self.imageView.width     = MineRatio(29);
    self.imageView.centerX   = self.width * 0.5;
    
    self.titleLabel.x        = 0;
    self.titleLabel.y        = self.imageView.botton + globalMargin * 0.5;
    self.titleLabel.width    = self.width;
    self.titleLabel.height   = self.height - self.imageView.botton - self.imageView.y;
    
}

@end
